'''
Created on Nov 29, 2011

@author: dstu
'''




class MaterialName(object):
    '''
    A container class to hold the various conjugations of the name of a
    material, e.g. "stone", "stones", "stony"
    '''
    
    singular = ""
    plural = ""
    adjective = ""
    
    
    def __init__(self, singular = None, plural = None, adjective = None):
        
        if not singular:
            self.__init__("rock")
            
        else:
            singular = singular.lower()
            self.singular = singular
            
            if not self.plural:
                self.plural = singular + "s"
            else:
                self.plural = plural
            
            if not adjective:
                self.adjective = singular + "y"
            else:
                self.adjective = adjective
                
    def getSingular(self):
        return self.singular
    
    def getPlural(self):
        return self.plural
    
    def getAdjective(self):
        return self.adjective
    
    def __str__(self):
        return ", ".join([self.getSingular(), self.getPlural(), self.getAdjective()])
    
    def __repr__(self):
        return "MaterialName(" + self.__str__() + ")"




class Material(object):
    
    def __init__(self, matName = MaterialName()):
        self.matName = matName




class MaterialSet(object):

    def __init__(self, materials, names):
        self.materials = materials
        self.names = names

    def getMaterials(self):
        return self.materials
    
    
    materials = [Material()]
    names = MaterialName("metal", adjective = "metallic")


def main():
    
    m1 = MaterialName()
    print m1

    m2 = MaterialName("stone", adjective = "stony")
    print m2

    m3 = MaterialName("metal", "metals", "metallic")
    print m3
    

if __name__ == "__main__":
    main()